package com.gitee.gphomework.pattern.commandpattern.command;

import com.gitee.gphomework.pattern.commandpattern.receiver.FtpCmdReceiver;

import java.util.Objects;

/**
 * Created on 2020/3/17
 * Title: 改变工作目录
 * Description: 如：“CWD dirname\r\n”。
 * Copyright: Copyright(c) 2020
 * Company:
 *
 * @author yifeng
 */
public class CwdCommand implements IFtpCommand {

    private FtpCmdReceiver cwdCmdReceiver;

    public CwdCommand(FtpCmdReceiver cwdCmdReceiver) {
        Objects.requireNonNull(cwdCmdReceiver);
        this.cwdCmdReceiver = cwdCmdReceiver;
    }

    @Override
    public void execute() {
        cwdCmdReceiver.cwd();
    }
}
